/*************************************************************************************************/
/*!
 *  \file
 *
 *  \brief      NRFX configuration.
 *
 *  Copyright (c) 2019-2020 Packetcraft, Inc.
 *  
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *  
 *      http://www.apache.org/licenses/LICENSE-2.0
 *  
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
/*************************************************************************************************/

#ifndef NRFX_CONFIG_H
#define NRFX_CONFIG_H

#define NRFX_CLOCK_ENABLED 1
#define NRFX_CLOCK_CONFIG_LF_SRC 1
#define NRFX_CLOCK_CONFIG_LF_CAL_ENABLED 0
#define NRFX_CLOCK_CONFIG_IRQ_PRIORITY 7

#define NRFX_CLOCK_CONFIG_LOG_ENABLED 0
#define NRFX_CLOCK_CONFIG_LOG_LEVEL 3
#define NRFX_CLOCK_CONFIG_INFO_COLOR 0
#define NRFX_CLOCK_CONFIG_DEBUG_COLOR 0

#define NRFX_COMP_ENABLED 0
#define NRFX_COMP_CONFIG_REF 1
#define NRFX_COMP_CONFIG_MAIN_MODE 0
#define NRFX_COMP_CONFIG_SPEED_MODE 2
#define NRFX_COMP_CONFIG_HYST 0
#define NRFX_COMP_CONFIG_ISOURCE 0
#define NRFX_COMP_CONFIG_INPUT 0
#define NRFX_COMP_CONFIG_IRQ_PRIORITY 7

#define NRFX_COMP_CONFIG_LOG_ENABLED 0
#define NRFX_COMP_CONFIG_LOG_LEVEL 3
#define NRFX_COMP_CONFIG_INFO_COLOR 0
#define NRFX_COMP_CONFIG_DEBUG_COLOR 0

#define NRFX_GPIOTE_ENABLED 1
#define NRFX_GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS 8
#define NRFX_GPIOTE_CONFIG_IRQ_PRIORITY 7

#define NRFX_GPIOTE_CONFIG_LOG_ENABLED 0
#define NRFX_GPIOTE_CONFIG_LOG_LEVEL 3
#define NRFX_GPIOTE_CONFIG_INFO_COLOR 0
#define NRFX_GPIOTE_CONFIG_DEBUG_COLOR 0

#define NRFX_I2S_ENABLED 1

#if AUDIO_CAPE
#define NRFX_I2S_CONFIG_SCK_PIN NRF_GPIO_PIN_MAP(1,11)
#define NRFX_I2S_CONFIG_LRCK_PIN NRF_GPIO_PIN_MAP(1,12)
#define NRFX_I2S_CONFIG_MCK_PIN NRF_GPIO_PIN_MAP(1,10)
#define NRFX_I2S_CONFIG_SDOUT_PIN NRF_GPIO_PIN_MAP(1,14)
#define NRFX_I2S_CONFIG_SDIN_PIN NRF_GPIO_PIN_MAP(1,13)
#elif defined(BOARD_NRF6832)
#define NRFX_I2S_CONFIG_SCK_PIN 19
#define NRFX_I2S_CONFIG_LRCK_PIN 20
#define NRFX_I2S_CONFIG_MCK_PIN NRFX_I2S_PIN_NOT_USED
#define NRFX_I2S_CONFIG_SDOUT_PIN 22
#define NRFX_I2S_CONFIG_SDIN_PIN 23
#else
#define NRFX_I2S_CONFIG_SCK_PIN 31
#define NRFX_I2S_CONFIG_LRCK_PIN 30
#define NRFX_I2S_CONFIG_MCK_PIN 255
#define NRFX_I2S_CONFIG_SDOUT_PIN 29
#define NRFX_I2S_CONFIG_SDIN_PIN 28
#endif

#define NRFX_I2S_CONFIG_MASTER 0
#define NRFX_I2S_CONFIG_FORMAT 0
#define NRFX_I2S_CONFIG_ALIGN 0
#define NRFX_I2S_CONFIG_SWIDTH 1
#define NRFX_I2S_CONFIG_CHANNELS 1
#define NRFX_I2S_CONFIG_MCK_SETUP 536870912
#define NRFX_I2S_CONFIG_RATIO 5
#define NRFX_I2S_CONFIG_IRQ_PRIORITY 7

#define NRFX_I2S_CONFIG_LOG_ENABLED 0
#define NRFX_I2S_CONFIG_LOG_LEVEL 3
#define NRFX_I2S_CONFIG_INFO_COLOR 0
#define NRFX_I2S_CONFIG_DEBUG_COLOR 0

#define NRFX_LPCOMP_ENABLED 0
#define NRFX_LPCOMP_CONFIG_REFERENCE 3
#define NRFX_LPCOMP_CONFIG_DETECTION 2
#define NRFX_LPCOMP_CONFIG_INPUT 0
#define NRFX_LPCOMP_CONFIG_HYST 0
#define NRFX_LPCOMP_CONFIG_IRQ_PRIORITY 7

#define NRFX_LPCOMP_CONFIG_LOG_ENABLED 0
#define NRFX_LPCOMP_CONFIG_LOG_LEVEL 3
#define NRFX_LPCOMP_CONFIG_INFO_COLOR 0
#define NRFX_LPCOMP_CONFIG_DEBUG_COLOR 0

#define NRFX_NFCT_ENABLED 0
#define NRFX_NFCT_CONFIG_IRQ_PRIORITY 7

#define NRFX_NFCT_CONFIG_LOG_ENABLED 0
#define NRFX_NFCT_CONFIG_LOG_LEVEL 3
#define NRFX_NFCT_CONFIG_INFO_COLOR 0
#define NRFX_NFCT_CONFIG_DEBUG_COLOR 0

#define NRFX_NVMC_ENABLED 0

#define NRFX_PDM_ENABLED 0
#define NRFX_PDM_CONFIG_MODE 1
#define NRFX_PDM_CONFIG_EDGE 0
#define NRFX_PDM_CONFIG_CLOCK_FREQ 138412032
#define NRFX_PDM_CONFIG_IRQ_PRIORITY 7

#define NRFX_PDM_CONFIG_LOG_ENABLED 0
#define NRFX_PDM_CONFIG_LOG_LEVEL 3
#define NRFX_PDM_CONFIG_INFO_COLOR 0
#define NRFX_PDM_CONFIG_DEBUG_COLOR 0

#define NRFX_POWER_ENABLED 0
#define NRFX_POWER_CONFIG_IRQ_PRIORITY 7
#define NRFX_POWER_CONFIG_DEFAULT_DCDCEN 0
#define NRFX_POWER_CONFIG_DEFAULT_DCDCENHV 0

#define NRFX_PPI_ENABLED 1

#define NRFX_PPI_CONFIG_LOG_ENABLED 0
#define NRFX_PPI_CONFIG_LOG_LEVEL 3
#define NRFX_PPI_CONFIG_INFO_COLOR 0
#define NRFX_PPI_CONFIG_DEBUG_COLOR 0

#define NRFX_PRS_ENABLED 0
#define NRFX_PRS_BOX_0_ENABLED 0
#define NRFX_PRS_BOX_1_ENABLED 0
#define NRFX_PRS_BOX_2_ENABLED 0
#define NRFX_PRS_BOX_3_ENABLED 0
#define NRFX_PRS_BOX_4_ENABLED 0

#define NRFX_PRS_CONFIG_LOG_ENABLED 0
#define NRFX_PRS_CONFIG_LOG_LEVEL 3
#define NRFX_PRS_CONFIG_INFO_COLOR 0
#define NRFX_PRS_CONFIG_DEBUG_COLOR 0

#define NRFX_PWM_ENABLED 0
#define NRFX_PWM0_ENABLED 0
#define NRFX_PWM1_ENABLED 0
#define NRFX_PWM2_ENABLED 0
#define NRFX_PWM3_ENABLED 0
#define NRFX_PWM_DEFAULT_CONFIG_OUT0_PIN 31
#define NRFX_PWM_DEFAULT_CONFIG_OUT1_PIN 31
#define NRFX_PWM_DEFAULT_CONFIG_OUT2_PIN 31
#define NRFX_PWM_DEFAULT_CONFIG_OUT3_PIN 31
#define NRFX_PWM_DEFAULT_CONFIG_BASE_CLOCK 4
#define NRFX_PWM_DEFAULT_CONFIG_COUNT_MODE 0
#define NRFX_PWM_DEFAULT_CONFIG_TOP_VALUE 1000
#define NRFX_PWM_DEFAULT_CONFIG_LOAD_MODE 0
#define NRFX_PWM_DEFAULT_CONFIG_STEP_MODE 0
#define NRFX_PWM_DEFAULT_CONFIG_IRQ_PRIORITY 7

#define NRFX_PWM_CONFIG_LOG_ENABLED 0
#define NRFX_PWM_CONFIG_LOG_LEVEL 3
#define NRFX_PWM_CONFIG_INFO_COLOR 0
#define NRFX_PWM_CONFIG_DEBUG_COLOR 0

#define NRFX_QDEC_ENABLED 0
#define NRFX_QDEC_CONFIG_REPORTPER 0
#define NRFX_QDEC_CONFIG_SAMPLEPER 7
#define NRFX_QDEC_CONFIG_PIO_A 31
#define NRFX_QDEC_CONFIG_PIO_B 31
#define NRFX_QDEC_CONFIG_PIO_LED 31
#define NRFX_QDEC_CONFIG_LEDPRE 511
#define NRFX_QDEC_CONFIG_LEDPOL 1
#define NRFX_QDEC_CONFIG_DBFEN 0
#define NRFX_QDEC_CONFIG_SAMPLE_INTEN 0
#define NRFX_QDEC_CONFIG_IRQ_PRIORITY 7

#define NRFX_QDEC_CONFIG_LOG_ENABLED 0
#define NRFX_QDEC_CONFIG_LOG_LEVEL 3
#define NRFX_QDEC_CONFIG_INFO_COLOR 0
#define NRFX_QDEC_CONFIG_DEBUG_COLOR 0

#define NRFX_QSPI_ENABLED 1
#define NRFX_QSPI_CONFIG_SCK_DELAY 1
#define NRFX_QSPI_CONFIG_XIP_OFFSET 0
#define NRFX_QSPI_CONFIG_READOC 0
#define NRFX_QSPI_CONFIG_WRITEOC 0
#define NRFX_QSPI_CONFIG_ADDRMODE 0
#define NRFX_QSPI_CONFIG_MODE 0
#define NRFX_QSPI_CONFIG_FREQUENCY 15
#if defined(BOARD_PCA10056)
#define NRFX_QSPI_PIN_SCK QSPI_PIN_SCK
#define NRFX_QSPI_PIN_CSN QSPI_PIN_CSNM
#define NRFX_QSPI_PIN_IO0 QSPI_PIN_IO0
#define NRFX_QSPI_PIN_IO1 QSPI_PIN_IO1
#define NRFX_QSPI_PIN_IO2 QSPI_PIN_IO2
#define NRFX_QSPI_PIN_IO3 QSPI_PIN_IO3
#else
#define NRFX_QSPI_PIN_SCK NRF_QSPI_PIN_NOT_CONNECTED
#define NRFX_QSPI_PIN_CSN NRF_QSPI_PIN_NOT_CONNECTED
#define NRFX_QSPI_PIN_IO0 NRF_QSPI_PIN_NOT_CONNECTED
#define NRFX_QSPI_PIN_IO1 NRF_QSPI_PIN_NOT_CONNECTED
#define NRFX_QSPI_PIN_IO2 NRF_QSPI_PIN_NOT_CONNECTED
#define NRFX_QSPI_PIN_IO3 NRF_QSPI_PIN_NOT_CONNECTED
#endif
#define NRFX_QSPI_CONFIG_IRQ_PRIORITY 7

#define NRFX_RNG_ENABLED 0
#define NRFX_RNG_CONFIG_ERROR_CORRECTION 1
#define NRFX_RNG_CONFIG_IRQ_PRIORITY 7

#define NRFX_RNG_CONFIG_LOG_ENABLED 0
#define NRFX_RNG_CONFIG_LOG_LEVEL 3
#define NRFX_RNG_CONFIG_INFO_COLOR 0
#define NRFX_RNG_CONFIG_DEBUG_COLOR 0

#define NRFX_RTC_ENABLED 1
#define NRFX_RTC0_ENABLED 0
#define NRFX_RTC1_ENABLED 1
#define NRFX_RTC2_ENABLED 0
#define NRFX_RTC_MAXIMUM_LATENCY_US 2000
#define NRFX_RTC_DEFAULT_CONFIG_FREQUENCY 32768
#define NRFX_RTC_DEFAULT_CONFIG_RELIABLE 0
#define NRFX_RTC_DEFAULT_CONFIG_IRQ_PRIORITY 7

#define NRFX_RTC_CONFIG_LOG_ENABLED 0
#define NRFX_RTC_CONFIG_LOG_LEVEL 3
#define NRFX_RTC_CONFIG_INFO_COLOR 0
#define NRFX_RTC_CONFIG_DEBUG_COLOR 0

#define NRFX_SAADC_ENABLED 0
#define NRFX_SAADC_CONFIG_RESOLUTION 1
#define NRFX_SAADC_CONFIG_OVERSAMPLE 0
#define NRFX_SAADC_CONFIG_LP_MODE 0
#define NRFX_SAADC_CONFIG_IRQ_PRIORITY 7

#define NRFX_SAADC_CONFIG_LOG_ENABLED 0
#define NRFX_SAADC_CONFIG_LOG_LEVEL 3
#define NRFX_SAADC_CONFIG_INFO_COLOR 0
#define NRFX_SAADC_CONFIG_DEBUG_COLOR 0

#define NRFX_SPIM_ENABLED 1
#define NRFX_SPIM0_ENABLED 0
#define NRFX_SPIM1_ENABLED 1
#define NRFX_SPIM2_ENABLED 0
#define NRFX_SPIM3_ENABLED 0
#define NRFX_SPIM_EXTENDED_ENABLED 0
#define NRFX_SPIM_MISO_PULL_CFG 1
#define NRFX_SPIM_DEFAULT_CONFIG_IRQ_PRIORITY 7

#define NRFX_SPIM_CONFIG_LOG_ENABLED 0
#define NRFX_SPIM_CONFIG_LOG_LEVEL 3
#define NRFX_SPIM_CONFIG_INFO_COLOR 0
#define NRFX_SPIM_CONFIG_DEBUG_COLOR 0
#define NRFX_SPIM3_NRF52840_ANOMALY_198_WORKAROUND_ENABLED 0

#define NRFX_SPIS_ENABLED 0
#define NRFX_SPIS0_ENABLED 0
#define NRFX_SPIS1_ENABLED 0
#define NRFX_SPIS2_ENABLED 0
#define NRFX_SPIS_DEFAULT_CONFIG_IRQ_PRIORITY 7
#define NRFX_SPIS_DEFAULT_DEF 255
#define NRFX_SPIS_DEFAULT_ORC 255

#define NRFX_SPIS_CONFIG_LOG_ENABLED 0
#define NRFX_SPIS_CONFIG_LOG_LEVEL 3
#define NRFX_SPIS_CONFIG_INFO_COLOR 0
#define NRFX_SPIS_CONFIG_DEBUG_COLOR 0

#define NRFX_SPI_ENABLED 0
#define NRFX_SPI0_ENABLED 0
#define NRFX_SPI1_ENABLED 0
#define NRFX_SPI2_ENABLED 0
#define NRFX_SPI_MISO_PULL_CFG 1
#define NRFX_SPI_DEFAULT_CONFIG_IRQ_PRIORITY 7

#define NRFX_SPI_CONFIG_LOG_ENABLED 0
#define NRFX_SPI_CONFIG_LOG_LEVEL 3
#define NRFX_SPI_CONFIG_INFO_COLOR 0
#define NRFX_SPI_CONFIG_DEBUG_COLOR 0

#define NRFX_SWI_ENABLED 0
#define NRFX_EGU_ENABLED 0
#define NRFX_SWI0_DISABLED 0
#define NRFX_SWI1_DISABLED 0
#define NRFX_SWI2_DISABLED 0
#define NRFX_SWI3_DISABLED 0
#define NRFX_SWI4_DISABLED 0
#define NRFX_SWI5_DISABLED 0

#define NRFX_SWI_CONFIG_LOG_ENABLED 0
#define NRFX_SWI_CONFIG_LOG_LEVEL 3
#define NRFX_SWI_CONFIG_INFO_COLOR 0
#define NRFX_SWI_CONFIG_DEBUG_COLOR 0
#define NRFX_SYSTICK_ENABLED 0

#define NRFX_TEMP_ENABLED 0
#define NRFX_TEMP_DEFAULT_CONFIG_IRQ_PRIORITY 7

#define NRFX_TIMER_ENABLED 1
#define NRFX_TIMER0_ENABLED 1
#define NRFX_TIMER1_ENABLED 1
#define NRFX_TIMER2_ENABLED 0
#define NRFX_TIMER3_ENABLED 0
#define NRFX_TIMER4_ENABLED 0
#define NRFX_TIMER_DEFAULT_CONFIG_FREQUENCY 0
#define NRFX_TIMER_DEFAULT_CONFIG_MODE 0
#define NRFX_TIMER_DEFAULT_CONFIG_BIT_WIDTH 0
#define NRFX_TIMER_DEFAULT_CONFIG_IRQ_PRIORITY 7

#define NRFX_TIMER_CONFIG_LOG_ENABLED 0
#define NRFX_TIMER_CONFIG_LOG_LEVEL 3
#define NRFX_TIMER_CONFIG_INFO_COLOR 0
#define NRFX_TIMER_CONFIG_DEBUG_COLOR 0

#define NRFX_TWIM_ENABLED 1
#define NRFX_TWIM0_ENABLED 1
#define NRFX_TWIM1_ENABLED 0
#define NRFX_TWIM_DEFAULT_CONFIG_FREQUENCY 26738688
#define NRFX_TWIM_DEFAULT_CONFIG_HOLD_BUS_UNINIT 0
#define NRFX_TWIM_DEFAULT_CONFIG_IRQ_PRIORITY 7

#define NRFX_TWIM_CONFIG_LOG_ENABLED 0
#define NRFX_TWIM_CONFIG_LOG_LEVEL 3
#define NRFX_TWIM_CONFIG_INFO_COLOR 0
#define NRFX_TWIM_CONFIG_DEBUG_COLOR 0

#define NRFX_TWIS_ENABLED 0
#define NRFX_TWIS0_ENABLED 0
#define NRFX_TWIS1_ENABLED 0
#define NRFX_TWIS_ASSUME_INIT_AFTER_RESET_ONLY 0
#define NRFX_TWIS_NO_SYNC_MODE 0
#define NRFX_TWIS_DEFAULT_CONFIG_ADDR0 0
#define NRFX_TWIS_DEFAULT_CONFIG_ADDR1 0
#define NRFX_TWIS_DEFAULT_CONFIG_SCL_PULL 0
#define NRFX_TWIS_DEFAULT_CONFIG_SDA_PULL 0
#define NRFX_TWIS_DEFAULT_CONFIG_IRQ_PRIORITY 7

#define NRFX_TWIS_CONFIG_LOG_ENABLED 0
#define NRFX_TWIS_CONFIG_LOG_LEVEL 3
#define NRFX_TWIS_CONFIG_INFO_COLOR 0
#define NRFX_TWIS_CONFIG_DEBUG_COLOR 0

#define NRFX_TWI_ENABLED 0
#define NRFX_TWI0_ENABLED 0
#define NRFX_TWI1_ENABLED 0
#define NRFX_TWI_DEFAULT_CONFIG_FREQUENCY 26738688
#define NRFX_TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT 0
#define NRFX_TWI_DEFAULT_CONFIG_IRQ_PRIORITY 7

#define NRFX_TWI_CONFIG_LOG_ENABLED 0
#define NRFX_TWI_CONFIG_LOG_LEVEL 3
#define NRFX_TWI_CONFIG_INFO_COLOR 0
#define NRFX_TWI_CONFIG_DEBUG_COLOR 0

#define NRFX_UARTE_ENABLED 1
#define NRFX_UARTE0_ENABLED 1
#define NRFX_UARTE1_ENABLED 0
#define NRFX_UARTE_DEFAULT_CONFIG_HWFC 0
#define NRFX_UARTE_DEFAULT_CONFIG_PARITY 0
#define NRFX_UARTE_DEFAULT_CONFIG_BAUDRATE UART_BAUD
#define NRFX_UARTE_DEFAULT_CONFIG_IRQ_PRIORITY 7

#define NRFX_UARTE_CONFIG_LOG_ENABLED 0
#define NRFX_UARTE_CONFIG_LOG_LEVEL 3
#define NRFX_UARTE_CONFIG_INFO_COLOR 0
#define NRFX_UARTE_CONFIG_DEBUG_COLOR 0

#define NRFX_UART_ENABLED 0
#define NRFX_UART0_ENABLED 0
#define NRFX_UART_DEFAULT_CONFIG_HWFC 0
#define NRFX_UART_DEFAULT_CONFIG_PARITY 0
#define NRFX_UART_DEFAULT_CONFIG_BAUDRATE UART_BAUD
#define NRFX_UART_DEFAULT_CONFIG_IRQ_PRIORITY 7

#define NRFX_UART_CONFIG_LOG_ENABLED 0
#define NRFX_UART_CONFIG_LOG_LEVEL 3
#define NRFX_UART_CONFIG_INFO_COLOR 0
#define NRFX_UART_CONFIG_DEBUG_COLOR 0

#define NRFX_USBD_ENABLED 0
#define NRFX_USBD_CONFIG_IRQ_PRIORITY 7
#define NRFX_USBD_CONFIG_DMASCHEDULER_ISO_BOOST 1
#define NRFX_USBD_CONFIG_ISO_IN_ZLP 0

#define NRFX_USBD_CONFIG_LOG_ENABLED 0
#define NRFX_USBD_CONFIG_LOG_LEVEL 3
#define NRFX_USBD_CONFIG_INFO_COLOR 0
#define NRFX_USBD_CONFIG_DEBUG_COLOR 0

#define NRFX_WDT_ENABLED 0
#define NRFX_WDT_CONFIG_BEHAVIOUR 1
#define NRFX_WDT_CONFIG_RELOAD_VALUE 2000
#define NRFX_WDT_CONFIG_NO_IRQ 0
#define NRFX_WDT_CONFIG_IRQ_PRIORITY 7

#define NRFX_WDT_CONFIG_LOG_ENABLED 0
#define NRFX_WDT_CONFIG_LOG_LEVEL 3
#define NRFX_WDT_CONFIG_INFO_COLOR 0
#define NRFX_WDT_CONFIG_DEBUG_COLOR 0

#endif  /* NRFX_CONFIG_H */
